/*
 * @Author: wlingL
 * @Date: 2023-09-04 15:11:30
 * @LastEditTime: 2023-09-07 10:03:28
 * @FilePath: \MDKd:\file\stm32\sv_stu\study_prj\Driver\inc\wifi.h
 * @Description:
 *
 */
#ifndef _WIFI_H_
#define _WIFI_H_

#include "main.h"
#include "stm32f10x.h"
#define WIFI_DELAY_MS 500
#define WaitWifi()                                                                                                               \
    do                                                                                                                           \
    {                                                                                                                            \
        while (!WifiSetFlag)                                                                                                     \
            ;                                                                                                                    \
        WifiSetFlag = 0;                                                                                                         \
    } while (0)
#define WifiClear()                                                                                                              \
    do                                                                                                                           \
    {                                                                                                                            \
        memset(g_Wifi_Buf, '\0', sizeof(g_Wifi_Buf));                                                                            \
        g_Wifi_len = 0;                                                                                                          \
    } while (0)

#define TCPClear()                                                                                                               \
    do                                                                                                                           \
    {                                                                                                                            \
        memset(data, '\0', sizeof(data));                                                                                        \
        TCP_GetData_len = 0;                                                                                                     \
    } while (0)
void Wifi_test(void);
void Wifi_mytest(void);
int GetWifiName(const char *str);
int TCP_GetData(const char *str);
int Wifi_Connect(u8 *ssid, u8 *pwd);
int TCP_Connect(u8 *type, u8 *addr, int port);
void CWLAP_disp(void);
int Wifi_ConnState(void);
extern u8 g_Wifi_Buf[1024];
extern int g_Wifi_len;
extern int TCP_GetData_len;
extern u8 WifiSetFlag;
extern char WifiName[10][100];
extern char data[100];
int Wifi_ConnState(void);
#endif // _WIFI_H_
